import matplotlib.pyplot as plt
import matplotlib.font_manager as fm

# 设置中文字体
font_path = 'C:/Windows/Fonts/simhei.ttf'  # 这里使用的是黑体字体路径，你可以根据需要更改
font_prop = fm.FontProperties(fname=font_path)
plt.rcParams['font.family'] = font_prop.get_name()

# 数据
data = {
    "北京": 0.098123,
    "上海": 0.088456,
    "天津": 0.079012,
    "江苏": 0.069345,
    "重庆": 0.059876,
    "广东": 0.054321,
    "浙江": 0.049876,
    "山东": 0.044567,
    "河南": 0.039876,
    "四川": 0.034567,
    "湖北": 0.029876,
    "福建": 0.024567,
    "湖南": 0.019876,
    "安徽": 0.017654,
    "辽宁": 0.015432,
    "陕西": 0.013210,
    "江西": 0.011098,
    "广西": 0.009876,
    "云南": 0.008765,
    "贵州": 0.007654,
    "山西": 0.006543,
    "吉林": 0.005432,
    "黑龙江": 0.004321,
    "内蒙古": 0.003210,
    "海南": 0.002109,
    "宁夏": 0.001098,
    "青海": 0.000987,
    "甘肃": 0.000876,
    "新疆": 0.000765,
    "西藏": 0.000654,
    "香港": 0.000432,
    "澳门": 0.000321,
    "台湾": 0.000543,
}

# 绘制条形图
plt.bar(data.keys(), data.values())
plt.xlabel('城市')
plt.ylabel('数据值')
# plt.title('城市数据条形图')
plt.xticks(rotation=45)

# 去掉条形图上面的比例标识
for spine in plt.gca().spines.values():
    spine.set_visible(False)

plt.show()